import { DeployFunction } from 'hardhat-deploy/types'
import { HardhatRuntimeEnvironment } from 'hardhat/types'
import { developmentChains } from '../helper-hardhat-config'

const ccipSimulator: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
  // 只在本地测试时部署
  if (!developmentChains.includes(hre.network.name)) return
  // code here
  const { firstAccount } = await hre.getNamedAccounts()
  const { deploy, log } = hre.deployments

  log('Deploying CCIP Simulator contract...')
  await deploy('CCIPLocalSimulator', {
    contract: 'CCIPLocalSimulator',
    from: firstAccount,
    log: true,
    args: []
  })
  log('CCIP Simulator contract deployed successfully!')
}

// 添加 tags
ccipSimulator.tags = ['test', 'all']

export default ccipSimulator
